home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 551-575 / disk_563 / reqlibrary / reqd.def < prev    next >
Text File  |  1992-05-06  |  21KB  |  365 lines

  1. DEFINITION MODULE ReqD;
  2. (*$ Implementation:=FALSE *)
  3.  
  4. IMPORT E: ExecD,
  5.        I: IntuitionD,
  6.        G: GraphicsD,
  7.        D: DosD,
  8.        S: SYSTEM,
  9.        RE: RexxD,
  10.        R;
  11.  
  12. CONST reqName       = "req.library";
  13.       reqMinVersion = 2;
  14.  
  15.       numpairs      = 9; (* ARRAY[0..numpairs] OF... anstatt ARRAY numpairs OF...
  16.                             in Oberon *)
  17.  
  18.  
  19. TYPE GadgetBlockPtr = POINTER TO GadgetBlock;
  20.  
  21.      GadgetBlock = RECORD
  22.                       gadget: I.Gadget;
  23.                       border: I.Border;
  24.                       pairs : ARRAY [0..numpairs] OF INTEGER;
  25.                       text  : I.IntuiText;
  26.                    END;
  27.  
  28. TYPE StringBlockPtr = POINTER TO StringBlock;
  29.  
  30.      StringBlock = RECORD
  31.                       gadget: I.Gadget;
  32.                       info  : I.StringInfo;
  33.                       border: I.Border;
  34.                       pairs : ARRAY [0..numpairs] OF INTEGER;
  35.                    END;
  36.  
  37. TYPE PropBlockPtr  = POINTER TO PropBlock;
  38.  
  39.      PropBlock  = RECORD
  40.                      gadget: I.Gadget;
  41.                      info  : I.PropInfo;
  42.                      image : I.Image;
  43.                   END;
  44.  
  45. TYPE ScrollBlockPtr  = POINTER TO ScrollBlock;
  46.  
  47.      ScrollBlock  = RECORD
  48.                        arrowUpLt: I.Gadget;
  49.                        imageUpLt: I.Image;
  50.                        arrowDnRt: I.Gadget;
  51.                        imageDnRt: I.Image;
  52.                        prop     : I.PropInfo;
  53.                     END;
  54.  
  55. TYPE TwoImageGadgetPtr  = POINTER TO TwoImageGadget;
  56.  
  57.      TwoImageGadget  = RECORD
  58.                           gadget: I.Gadget;
  59.                           image1: I.Image;
  60.                           image2: I.Image;
  61.                        END;
  62.  
  63. CONST VERTSLIDER   = 16;  (* Default: Horizontal Slider*)
  64.       HORIZSLIDER  = 0;
  65.  
  66. (*This structure is used with the TextRequester function.*)
  67.  
  68. TYPE TRStructurePtr  = POINTER TO TRStructure;
  69.  
  70.      TRStructure  = RECORD
  71.                        text         : S.ADDRESS;   (* This is the message text, including printf() style formatting if desired.*)
  72.                        controls     : S.ADDRESS;   (* This is the address of the parameter list, if printf() style formatting is used. *)
  73.                        window       : I.WindowPtr; (* This is an optional (zero if not used) pointer to a window on the screen you*)
  74.                                   (* would like the requester to show up on.*)
  75.                        middleText   : S.ADDRESS;   (* If non-zero, this is the text for the gadget in the lower middle (returns 2).*)
  76.                        positiveText : S.ADDRESS;   (* If non-zero, this is the text for the gadget in the lower left hand corner (returns 1).*)
  77.                        negativeText : S.ADDRESS;   (* If non-zero, this is the text for the gadget in the lower right (returns 0).*)
  78.                        title        : S.ADDRESS;   (* This is the title for the window.*)
  79.                        keyMask      : S.BITSET;    (* This is the qualifier mask for the keyboard shortcuts.*)
  80.                                   (* Use -1 to allow any qualifiers (or none).*)
  81.                                   (* Zero means that no keyboard shortcuts are allowed.*)
  82.                        textcolor    : INTEGER;     (* Color of the text.  Uses color 1 if no color specified.*)
  83.                        detailcolor  : INTEGER;     (* Detail and block color, as in a NewWindow structure.  If*)
  84.                        blockcolor   : INTEGER;     (* both are left zero, block pen will be set to 1.*)
  85.                        versionnumber: INTEGER;     (* Make SURE this is set to reqversion.*)
  86.                        timeout      : CARDINAL;    (* the timeout value in seconds *)
  87.                        abortMask    : S.LONGSET;   (* If the requester gets a Signal() with this bit, it will abort *)
  88.                        rfu1         : INTEGER;     (* Make SURE you leave these two zeroed also.*)
  89.                     END;
  90.  
  91. (*NOTE:
  92.     The  control  values  mentioned above are used if you choose to insert
  93. printf  style directives in your strings and should contain the address of
  94. a list of control parameters, usually on the stack.
  95.    *)
  96.  
  97. (*         Remember,   if  you  don't  want  to  go  through  the  hassle  of
  98.    initializing a ExtendedColorRequester structure, you can always just call
  99.    ColorRequester  (as opposed to ExtendedColorRequester).  ColorRequester
  100.    just  takes  a  single  parameter, in D0, the color that should start out
  101.    being highlit.  It returns a single value, the color that was selected at
  102.    the end. *)
  103.  
  104. (*         This structure is for use with the ExtendedColorRequester (_not_, *)
  105. (* the ColorRequester) function.*)
  106.  
  107. TYPE ExtendedColorRequesterPtr  = POINTER TO ExtendedColorRequester;
  108.  
  109.      ExtendedColorRequester  = RECORD
  110.                                   defcolor: LONGINT;     (*The color that is initially highlit.   *)
  111.                                   window  : I.WindowPtr; (*The window the 'requester' opens up in.*)
  112.                                   rfu1    : LONGINT;     (*Who knows what these will be used for, *)
  113.                                   rfu2    : LONGINT;     (*but I'm sure we'll think of something. *)
  114.                                   rfu3    : LONGINT;     (*Until then, just keep these zeroed.    *)
  115.                                   rfu4    : LONGINT;     (*Okay?*)
  116.                                   rfu5    : LONGINT;
  117.                                END;
  118.  
  119. (*         This structure is for use with the GetLong function.*)
  120.  
  121. CONST glnodefault  = 0;(*Set this bit in the flags if you don't want a default*)
  122.                         (*value to show up in the get long string gadget.  For*)
  123.                         (*some things this is much better than having a zero  *)
  124.                         (*show up.*)
  125.  
  126. TYPE GetLongStructPtr  = POINTER TO GetLongStruct;
  127.  
  128.      GetLongStruct  = RECORD
  129.                          titlebar     : S.ADDRESS;
  130.                          defaultval   : LONGINT;
  131.                          minlimit     : LONGINT;
  132.                          maxlimit     : LONGINT;
  133.                          result       : LONGINT;
  134.                          window       : I.WindowPtr;
  135.                          versionnumber: INTEGER; (* Make SURE this is set to reqversion.*)
  136.                          flags        : S.LONGSET; (* Some, uh flags.  See above for bit definitions.*)
  137.                          rfu2         : LONGINT;
  138.                       END;
  139.  
  140. TYPE GetStringStructPtr  = POINTER TO GetStringStruct;
  141.  
  142.      GetStringStruct  = RECORD
  143.                            titlebar     : S.ADDRESS;
  144.                            stringbuffer : S.ADDRESS;
  145.                            window       : I.WindowPtr;
  146.                            stringsize   : INTEGER; (*how many characters in the buffer*)
  147.                            visiblesize  : INTEGER; (*how many characters show on screen*)
  148.                            versionnumber: INTEGER; (* make SURE this is reqversion *)
  149.                            flags        : S.LONGSET;
  150.                            rfu1         : LONGINT;
  151.                            rfu2         : LONGINT;
  152.                            rfu3         : LONGINT;
  153.                         END;
  154.  
  155. CONST dsize       = 130;
  156.       fchars      =  30;
  157.       wildlength  =  30;
  158.  
  159. TYPE DirString       = ARRAY[0..dsize] OF CHAR;
  160.      DirStringPtr    = POINTER TO DirString;
  161.      FileString      = ARRAY[0..fchars] OF CHAR;
  162.      FileStringPtr   = POINTER TO FileString;
  163.      PathString      = ARRAY[0..dsize+fchars+1] OF CHAR;
  164.      PathStringPtr   = POINTER TO PathString;
  165.      ShowHideString  = ARRAY[0..wildlength + 2] OF CHAR;
  166. (*
  167.    These  are  the  bit  numbers  of various bits that you can set in the
  168. Flags  field of the file requester structure.  The actual values that come
  169. out of these bit numbers are defined in the set of includes below with the
  170. same  names  but  with  an  M  (for  mask) ending instead of a B (for bit)
  171. ending.
  172.   *)
  173.  
  174. TYPE UmmFlags = (showinfo,extselect,caching,getfonts,
  175.                   infogadget,hidewilds,absolutexy,cachepurge,
  176.                   nohalfcache,nosort,nodrag,saving,
  177.                   loading,dironly,umm14,umm15,
  178.                   umm16,umm17,umm18,umm19,
  179.                   umm20,umm21,umm22,umm23,
  180.                   umm24,umm25,umm26,umm27,
  181.                   umm28,umm29,umm30,umm31);
  182.       UmmFlagSet = SET OF UmmFlags;
  183.  
  184. (* CONST
  185.      showinfo    = 0;  (*Set this in Flags if you want .info files to show.  They default to hidden.*)
  186.      extselect   = 1;  (*Set this in Flags if you want extended select.  Default is not.*)
  187.      caching     = 2;  (*Set this in Flags if you want directory caching.  Default is not.*)
  188.      getfonts    = 3;  (*Set this in Flags if you want a font requester rather than a file requester.*)
  189.      infogadget  = 4;  (*Set this in Flags if you want a hide-info files gadget.*)
  190.      hidewilds   = 5;  (*Set this in Flags if you DON'T want 'show' and 'hide' string gadgets.*)
  191.      absolutexy  = 6;  (*Use absolute x,y positions rather than centering on mouse.*)
  192.      cachepurge  = 7;  (*Purge the cache whenever the directory date stamp changes if this is set.*)
  193.      nohalfcache = 8;  (*Don't cache a directory unless it is completely read in when this is set.*)
  194.      nosort      = 9;  (*Set this in Flags if you DON'T want sorted directories.*)
  195.      nodrag      = 10; (*Set this in Flags if you DON'T want a drag bar and depth gadgets.*)
  196.      saving      = 11; (*Set this bit if you are selecting a file to save to.*)
  197.      loading     = 12; (*Set this bit if you are selecting a file(s) to load from.*)
  198.                         (*These two bits (save and load) aren't currently used for*)
  199.                         (*anything, but they may be in the future, so you should*)
  200.                         (*remember to set them.  Also, these bits make it easier if*)
  201.                         (*somebody wants to customize the file requester for their*)
  202.                         (*machine.  They can make it behave differently for loading*)
  203.                         (*vs saving.*)
  204.      dironly     = 13; (*Allow the user to select a directory, rather than a file.*)
  205.  
  206. *)
  207.  
  208. TYPE ESStructurePtr   = POINTER TO ESStructure;
  209.  
  210.      ESStructure  = RECORD
  211.                        nextFile       : ESStructurePtr;
  212.                        nameLength     : INTEGER; (*Length of the filename field, not including the terminating zero.*)
  213.                        pad            : INTEGER;
  214.                        node           : S.ADDRESS;     (*For internal use only.*)
  215.                        thefilename    : ARRAY[0..255] OF CHAR; (*This is (was) a variable size field.*)
  216.                     END;
  217.  
  218.  
  219. TYPE ReqFileRequesterPtr   = POINTER TO ReqFileRequester;
  220.  
  221.      ReqFileRequester  = RECORD
  222.                             versionNumber      : INTEGER;  (*Make SURE this is set to reqversion.*)
  223.                             title              : S.ADDRESS;  (*Hailing text*)
  224.                             dir                : DirStringPtr;  (*Directory array (DSIZE+1)*)
  225.                             file               : FileStringPtr; (*Filename array (FCHARS+1)*)
  226.                             pathName           : PathStringPtr; (*Complete path name array (DSIZE+FCHARS+2)*)
  227.                             window             : I.WindowPtr;   (*Window requesting or NULL*)
  228.  
  229.                             maxExtendedSelect  : CARDINAL;  (*Zero implies a maximum of 65535, as long as FRQEXTSELECT is set.*)
  230.                             numlines           : CARDINAL;  (*Number of lines in file window.*)
  231.                             numcolumns         : CARDINAL;  (*Number of columns in file window.*)
  232.                             devcolumns         : CARDINAL;
  233.                             flags              : UmmFlagSet; (*Various - umm - flags.  See above for more info.*)
  234.                             dirnamescolor      : CARDINAL;  (*These five colors will all default*)
  235.                             filenamescolor     : CARDINAL;  (*to color one if you don't specify*)
  236.                             devicenamescolor   : CARDINAL;  (*a color (ie; if you specify color zero).*)
  237.                             fontnamescolor     : CARDINAL;  (*If you want color zero to be used, specify*)
  238.                             fontsizescolor     : CARDINAL;  (*color 32, or some other too large number*)
  239.                                                  (*which mods down to zero.*)
  240.                             detailcolor        : CARDINAL;  (*If both of these colors are specified as*)
  241.                             blockcolor         : CARDINAL;  (*zero then the block pen will be set to one.*)
  242.  
  243.                             gadgettextcolor    : CARDINAL;   (*The color for the text of the five boolean gadgets.  Defaults to 1.*)
  244.                             textmessagecolor   : CARDINAL;   (*The color for the message at the screen top.  Defaults to 1.*)
  245.                             stringnamecolor    : CARDINAL;   (*The color for the words Drawer, File, Hide and Show.  Defaults to 3.*)
  246.                             stringgadgetcolor  : CARDINAL;   (*The color for the borders of the string gadgets.  Defaults to 3.*)
  247.                                        (*Unfortunately it is not possible to specify*)
  248.                                        (*the color of the actual text in an Intuition*)
  249.                                        (*string gadget.*)
  250.                             boxbordercolor    : CARDINAL;   (*The color for the boxes around the file and directory areas.  Defaults to 3.*)
  251.                             gadgetboxcolor    : CARDINAL;   (*The color for the boxes around the five boolean gadgets.  Defaults to 3.*)
  252.  
  253.                             stuff             : ARRAY[0..17] OF CARDINAL; (*This area, which is reserved for*)
  254.                                                  (*future use, should all be zero.*)
  255.  
  256.                             dirDateStamp      : D.Date; (*A copy of the cached directories date stamp.*)
  257.                                       (*There should never be any need to change this.*)
  258.  
  259.                             windowLeftEdge    : CARDINAL;  (*These two fields are only used when the*)
  260.                             windowTopEdge     : CARDINAL;  (*FRQABSOLUTEXY flag is set.  They specify*)
  261.                                       (*the location of the upper left hand*)
  262.                                       (*corner of the window.*)
  263.  
  264.                             fontYSize         : CARDINAL;     (*These fields are used to return the selected*)
  265.                             fontStyle         : CARDINAL;     (*font size and style, only applicable when the*)
  266.                                       (*font bit is set.*)
  267.  
  268.    (*If you set the extended select bit and the user extended selects, the list of filenames will start from here.*)
  269.                             extendedSelect    : ESStructurePtr;
  270.                             hide              : ShowHideString; (*The wildcards text.*)
  271.                             show              : ShowHideString; (*More wildcards text.*)
  272.                             fileBufferPos     : INTEGER; (*Various fields taken from the various*)
  273.                             fileDispPos       : INTEGER; (*string gadgets so that the cursor*)
  274.                             dirBufferPos      : INTEGER; (*can be returned to the same position*)
  275.                             dirDispPos        : INTEGER; (*on subsequent calls.*)
  276.                             hideBufferPos     : INTEGER;
  277.                             hideDispPos       : INTEGER;
  278.                             showBufferPos     : INTEGER;
  279.                             showDispPos       : INTEGER;
  280.  
  281. (*     The  following  fields are PRIVATE!  Don't go messing with them or
  282.   wierd  things may/will happen.  If this isn't enough of a warning, go read
  283.   the one in intuition.h, that should scare you off.  *)
  284.  
  285.                              memory           : S.ADDRESS;    (*Memory allocate for dir entries.   *)
  286.                              memory2          : S.ADDRESS;    (*More memory, used for hidden files.*)
  287.                              lock             : S.ADDRESS;
  288.                              privateDirBuffer : ARRAY[0..dsize+1] OF CHAR; (*Used for keeping a record of which*)
  289.                                              (*directory we have file names for.*)
  290.                              fileInfoBlock    : D.FileInfoBlock;
  291.                              numEntries       : INTEGER;
  292.                              numHiddenEntries : INTEGER;
  293.                              filestartnumber  : INTEGER;
  294.                              devicestartnumber: INTEGER;
  295.                           END;
  296.  
  297.  
  298. (*       This is used with the RealTimeScroll function.*)
  299.  
  300. TYPE ReqScrollStructPtr  = POINTER TO ReqScrollStruct;
  301.  
  302.      ReqScrollStruct  = RECORD
  303.                         topEntryNumber   : LONGCARD; (*This is the ordinal number of the first*)
  304.                                  (*displayed entry.*)
  305.                         numEntries       : LONGCARD; (*This is the total number of entries in*)
  306.                                              (*the list.*)
  307.                         lineSpacing      : CARDINAL; (*This is how many pixels high each entry is.*)
  308.                         numLines         : LONGCARD; (*This is how many entries can be displayed simultaneously.*)
  309.                         propGadget       : I.Gadget;(*This is a pointer to the prop gadget being monitored.*)
  310.  
  311.                         RedrawAll  : PROCEDURE(); (*This routine is used to redraw all of the*)
  312.                               (*entries when the user moves far enough*)
  313.                               (*that scrolling will take too long.*)
  314.  
  315.                         ReadMore   : PROCEDURE(); (*An optional routine that is called when*)
  316.                               (*the scroll routine is waiting for movement.*)
  317.                               (*This allows reading of new data while real*)
  318.                               (*time scrolling.*)
  319.                         ScrollAndDraw   : PROCEDURE((*{R.D0},{R.D1},{R.D2},{R.D3}*)); (*This routine is called when the data needs*)
  320.                               (*to be scrolled and updated.  This routine is*)
  321.                               (*passed four long parameters (on the stack and*)
  322.                               (*in D0-D3) which are, respectively:*)
  323.                               (*D0 - entry number of first line to be drawn.*)
  324.                               (*D1 - pixel offset to draw first line at.*)
  325.                               (*D2 - amount to scroll before doing any drawing.*)
  326.                               (*D3 - number of lines of data to draw.*)
  327.                         versionnumber  : INTEGER; (*Make SURE this is set to reqversion.*)
  328.                         rfu1       : LONGINT;     (*Make SURE you leave these two zeroed also.*)
  329.                         rfu2       : LONGINT;     (*Make SURE you leave these two zeroed also.*)
  330.                      END;
  331.  
  332. TYPE ChipstuffPtr   = POINTER TO Chipstuff;
  333.  
  334.      Chipstuff  = RECORD
  335.                      arrowUp      : ARRAY[0..9] OF INTEGER; (*16 pixels wide, 10 pixels high.*)
  336.                      arrowDown    : ARRAY[0..9] OF INTEGER; (*16 pixels wide, 10 pixels high.*)
  337.                      arrowLeft    : ARRAY[0..8] OF INTEGER; (*16 pixels wide, 9 pixels high. *)
  338.                      arrowRight   : ARRAY[0..8] OF INTEGER; (*16 pixels wide, 9 pixels high. *)
  339.                      letterR      : ARRAY[0..9] OF INTEGER; (*16 pixels wide, 10 pixels high.*)
  340.                      letterG      : ARRAY[0..9] OF INTEGER; (*16 pixels wide, 10 pixels high.*)
  341.                      letterB      : ARRAY[0..9] OF INTEGER; (*16 pixels wide, 10 pixels high.*)
  342.                      letterH      : ARRAY[0..9] OF INTEGER; (*16 pixels wide, 10 pixels high.*)
  343.                      letterS      : ARRAY[0..9] OF INTEGER; (*16 pixels wide, 10 pixels high.*)
  344.                      letterV      : ARRAY[0..9] OF INTEGER; (*16 pixels wide, 10 pixels high.*)
  345.                   END;
  346.  
  347. TYPE ReqLibPtr   = POINTER TO  ReqLib;
  348.  
  349.      ReqLib  = RECORD
  350.                   rLib            : E.LibraryPtr;
  351.                   sysLib          : E.ExecBasePtr;
  352.                   dosLib          : D.DosLibraryPtr;
  353.                   intuiLib        : I.IntuitionBasePtr;
  354.                   gfxLib          : G.GfxBasePtr;
  355.                   segList         : S.BPTR;
  356.                   images          : ChipstuffPtr;
  357.                   flags           : S.BITSET;
  358.                   pad             : SHORTINT;
  359.                   consoleDev      : S.ADDRESS;   (*Not really a char, but it should work*)
  360.                   consoleHandle   : E.IOStdReqPtr;
  361.                   rexxSysBase     : RE.RxsLibPtr;
  362.                END;
  363.  
  364. END ReqD.
  365.